package net.bezrabotnih.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;
import net.bezrabotnih.client.managed.request.CommentProxy;

public class CommentProxyRenderer extends ProxyRenderer<CommentProxy> {

    private static net.bezrabotnih.client.managed.ui.CommentProxyRenderer INSTANCE;

    protected CommentProxyRenderer() {
        super(new String[] { "text" });
    }

    public static net.bezrabotnih.client.managed.ui.CommentProxyRenderer instance() {
        if (INSTANCE == null) {
            INSTANCE = new CommentProxyRenderer();
        }
        return INSTANCE;
    }

    public String render(CommentProxy object) {
        if (object == null) {
            return "";
        }
        return object.getText() + " (" + object.getId() + ")";
    }
}
